From c218d894347b4af9f6ca8e0350236a8cb29bdffd Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Tue, 2 Jan 2001 12:10:57 +0000 Subject: [PATCH] (pos_visible_p): Take into account that CHARPOS maybe in or at the start of invisible text. --- src/xdisp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index ed98ced48a2..c1b312f1a42 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1012,8 +1012,9 @@ pos_visible_p (w, charpos, fully, exact_mode_line_heights_p) start_display (&it, w, top); move_it_to (&it, charpos, 0, it.last_visible_y, -1, MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); - - if (IT_CHARPOS (it) == charpos) + + /* Note that we may overshoot because of invisible text. */ + if (IT_CHARPOS (it) >= charpos) { int line_height, line_bottom_y; int line_top_y = it.current_y; -- 2.30.2